package com.yc.chaoshi.cs_order.mapper;

import com.yc.chaoshi.entity.PmsPl;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author xz
 * @since 2022-08-13
 */
public interface PmsPlMapper extends BaseMapper<PmsPl> {

    @Select("select p.id,plword,username,pltime from pms_pl p join ums_user u on uid=u.id where gid=#{id} "+
            " limit #{page},3")
    List<PmsPl> findPl(@Param("id") int id,
                       @Param("page") int page);

    @Select("select count(*) cnt from pms_pl p join ums_user u on uid=u.id where gid=#{id} " )
    Map<String,Object> countPl(@Param("id")int id);
}
